﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZHDJ.Data.Models.Box
{
    public class DboDept
    {
        #region 字段属性

        public string ID { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [NotMapped]
        public string DeptName { get; set; }

        /// <summary>
        /// 上级部门ID
        /// </summary>
        [NotMapped]
        public string UPID { get; set; }

        /// <summary>
        /// 部门分类
        /// </summary>
        [NotMapped]
        public string SortInfo { get; set; }

        /// <summary>
        /// 部门等级
        /// </summary>
        [NotMapped]
        public string DeptLevel { get; set; }

        #endregion


        #region 数据查询


        public static Object GetDeptName(string DN)
        {
            var sql = "select id from dbo.deptinfo where deptname='"+DN+"'";

            return SqlServerHelper.ExecuteScalar(sql);
        }

        #endregion

    }
}
